package com.java2007.entity;

/**
 * 用于包装订单模块返回的结果
 * @author ZOU
 */
public class Result {

    private boolean sunccess;
    //错误或成功的消息
    private String message;
    //需要返回的数据
    private Object data;

    public boolean isSunccess() {
        return sunccess;
    }

    public void setSunccess(boolean sunccess) {
        this.sunccess = sunccess;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Result(boolean sunccess, String message, Object data) {
        this.sunccess = sunccess;
        this.message = message;
        this.data = data;
    }

    public Result() {
    }
    public static Result ok(String message){
        return new Result(true,message,null);
    }
    public static Result ok(String message,Object data){
        return new Result(true,message,data);
    }
    public static Result fail(String message){
        return new Result(false,message,null);
    }
    public static Result fail(String message,Object data){
        return new Result(false,message,data);
    }
}
